package com.wing.common.util;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.wing.common.Constants;

/**
 *  General purpose utilities
 *
 */
public class RequestUtils
{
  

  /**
   *  Generate something resembling a guid for this host
   *
   *
   */
  public static String getSitePath(HttpServletRequest request)
  {
	  String sitePath = (String)request.getSession().getAttribute(Constants.SESSION_SITE_PATH);
		if(sitePath==null){
			sitePath = (String)request.getSession().getAttribute(Constants.SESSION_SITE_ACCESS_PATH);
		}
		return sitePath;
  }
  public static String getSitePath(HttpSession session)
  {
	  String sitePath = (String)session.getAttribute(Constants.SESSION_SITE_PATH);
		if(sitePath==null){
			sitePath = (String)session.getAttribute(Constants.SESSION_SITE_ACCESS_PATH);
		}
		return sitePath;
  }

  
}
